package com.wangwen.wechatmp.exception;

public class RuntimeCheckException extends RuntimeException{
    private static final long serialVersionUID = -9221941718593423481L;

//    public RuntimeCheckException(String message) {
//        super(message);
//    }
    private String msg;
    private int code = 500;

    public RuntimeCheckException(String msg) {
        super(msg);
        this.msg = msg;
    }

    public RuntimeCheckException(String msg, Throwable e) {
        super(msg, e);
        this.msg = msg;
    }

    public RuntimeCheckException(String msg, int code) {
        super(msg);
        this.msg = msg;
        this.code = code;
    }

    public RuntimeCheckException(String msg, int code, Throwable e) {
        super(msg, e);
        this.msg = msg;
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }
    /**
     * 重写fillInStackTrace方法会使得这个自定义的异常不会收集线程的整个异常栈信息，会大大
     * 减少异常开销。
     */
    @Override
    public synchronized Throwable fillInStackTrace() {
        return this;
    }

}
